<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.min.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <!--<script src="cordova.js"></script>-->

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/todo.services.js"></script>
  </head>
  <body ng-app="todointech" ng-controller="TodoIntechCtrl">
    <ion-header-bar class="bar-positive">
        <button  class="button button-icon ion-ios7-minus-outline" ng-click="data.showDelete=!data.showDelete; data.showReorder=false"></button>
        <h1 class="title">TODO Tasks</h1>
        <!-- <button  class="button button-icon ion-arrow-move" ng-click="data.showDelete=false; data.showReorder=!data.showReorder"></button> -->
        <button class="button button-icon pull-right" ng-click="newTask()">
          <i class="icon ion-compose"></i>
      </button>
    </ion-header-bar>
    <ion-content>
        <ion-list show-delete="data.showDelete" show-reorder="data.showReorder">
            <ion-item ng-show="!tasks.length">Not task</ion-item>
            
            <ion-item ng-show="tasks.length" ng-repeat="task in tasks" item="task" class="item-icon-left">
                <i class="icon ion-ios7-copy-outline"></i>{{task.task_name}}
                <ion-delete-button class="ion-ios7-minus-outline" ng-click="onItemDelete(task.task_id)"></ion-delete-button>
                <ion-option-button class="button-assertive" ng-click="onItemEdit(task.task_id)">Edit</ion-option-button>
                <!-- <ion-reorder-button class="ion-navicon" on-reorder="moveItem(task.task_id, $fromIndex, $toIndex)"></ion-reorder-button> -->
            </ion-item>
        </ion-list>
    </ion-content>
  
  <script id="new-task.html" type="text/ng-template">
      <div class="modal">
        <ion-header-bar class="bar-stable">
            <h1 class="title">New task</h1>
            <button class="button button-clear button-positive" ng-click="closeNewTask()">Cancel</button>
        </ion-header-bar>    
        <ion-content>
            <form ng-submit="createTask(task)">
                <label class="item item-input">
                    <input type="text" placeholder="What you need to do?" ng-model="task.title" />
                </lable>
                <div class="padding">
                    <button type="submit" class="button button-block button-positive">Create task</button>
                </div>
            </form>
        </ion-content>
        
      </div>
  </script>
  
  <div class="bar bar-footer bar-positive">
    <a class="title" href="http://intechhost.com" style="text-decoration:none;" target="_blank">www.intechhost.com</a>
  </div>
  </body>
</html>
